home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmWhatAmI
- Caption = "The WhatAmI Program"
- ClientHeight = 5355
- ClientLeft = 975
- ClientTop = 690
- ClientWidth = 7770
- Height = 5760
- Icon = WHATAMI.FRX:0000
- Left = 915
- LinkTopic = "Form1"
- Picture = WHATAMI.FRX:0302
- ScaleHeight = 5355
- ScaleWidth = 7770
- Top = 345
- Width = 7890
- Begin CommandButton cmdExit
- Caption = "E&xit"
- Height = 495
- Left = 3360
- TabIndex = 2
- Top = 4680
- Width = 1215
- End
- Begin CommandButton cmdWhoAmI
- Caption = "What Am I?"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 495
- Left = 3120
- TabIndex = 1
- Top = 120
- Width = 2055
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00000000&
- Height = 495
- Left = 2520
- TabIndex = 0
- Top = 720
- Width = 3375
- End
- Option Explicit
- ' Declare constants
- Const WF_CPU286 = &H2
- Const WF_CPU386 = &H4
- Const WF_CPU486 = &H8
- ' Declare the GetWinFlags() DLL function
- Declare Function GetWinFlags Lib "Kernel" () As Long
- ' Declare a variable the will hold the session number.
- Dim gSessionNumber
- ' Declare constants
- Const SP_START_OF_FILE = -1
- Const SP_END_OF_FILE = -2
- ' Declare the sp_OpenSession() function from
- ' the TegoSND.DLL library.
- Declare Function sp_OpenSession Lib "TegoSND.DLL" (ByVal lpstrFileName As String) As Integer
- ' Declare the sp_PlaySnd() function from
- ' the TegoSND.DLL library.
- Declare Function sp_PlaySnd Lib "TegoSND.DLL" (ByVal iSessionHandler As Integer, ByVal lStartPoint As Long, ByVal lEndPoint As Long) As Long
- ' Declare the sp_CloseSession() function from
- ' the TegoSND.DLL library.
- Declare Function sp_CloseSession Lib "TegoSND.DLL" (ByVal iSessionHandler As Integer) As Integer
- Sub cmdExit_Click ()
- Dim Dummy
- Dummy = sp_CloseSession(gSessionNumber)
- ' Terminate the application
- End
- End Sub
- Sub cmdWhoAmI_Click ()
- Dim ThisIsWhatIAm
- Dim Dummy
- ThisIsWhatIAm = GetWinFlags()
- ' Play I am...
- Dummy = sp_PlaySnd(gSessionNumber, SP_START_OF_FILE, 16200)
- If ThisIsWhatIAm And WF_CPU286 Then
-
- Label1.Caption = "I Am a 80286"
- frmWhatAmI.Refresh
-
- ' Play the WAV file through the PC speaker
- Dummy = sp_PlaySnd(gSessionNumber, 17600, 42200)
-
- Exit Sub
- End If
- If ThisIsWhatIAm And WF_CPU386 Then
-
- Label1.Caption = "I Am a 80386"
- frmWhatAmI.Refresh
- ' Play the WAV file through the PC speaker
- Dummy = sp_PlaySnd(gSessionNumber, 58290, 87150)
-
- Exit Sub
- End If
- If ThisIsWhatIAm And WF_CPU486 Then
-
- Label1.Caption = "I Am a 80486"
- frmWhatAmI.Refresh
-
- ' Play the WAV file through the PC speaker
- Dummy = sp_PlaySnd(gSessionNumber, 98970, 131000)
-
- Exit Sub
- End If
-
- Label1.Caption = "I don't know who am I..."
- End Sub
- Sub Form_Load ()
- ' Open a WAV session
- gSessionNumber = sp_OpenSession("C:\MVPROG\WAV\WHATAMI.WAV")
- End Sub
- Sub Form_Unload (Cancel As Integer)
- cmdExit_Click
- End Sub
-